#include"../source/server.hpp"

int main()
{
    Socket cli_sock;
    bool ret = cli_sock.CreateClient(8081,"127.0.0.1");
    if(ret == false)
    {
        ERR_LOG("create newlink error");
        abort();
    }
    cout << "Create Client Success"<< endl;
    for(int i = 0 ; i < 5 ; i++)
    {
        string str = "hello server";
        cli_sock.Send(str.c_str(),str.size());
        char buf[1024] = {0};
        int size = cli_sock.Recv(buf,1023);
        buf[size] = 0;
        DBG_LOG("client recv:%s",buf);
        sleep(1);
    }
    while(1)
    {
        sleep(1);
    }
    return 0;
}
